﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

namespace NinjaToolbox.SubComponentModule.Example
{
    [TargetModel(typeof(SE2_Jump_Model))]
    public class SE2_Jump_ModelEditor : SubComponentModelEditorBase
    {
        protected override float GetInspectorGUIHeight()
        {
            return 45;
        }

        protected override void OnInspectorGUI(Rect rect)
        {
            var model = base.mTarget as SE2_Jump_Model;

            var height = rect.y;
            var labelWidth = 120;
            EditorGUI.LabelField(new Rect(rect.x, height, labelWidth, 20), "Jump Force");
            model.jumpForce = EditorGUI.FloatField(new Rect(rect.x + labelWidth, height, rect.width - labelWidth, 20), model.jumpForce);
            height += 20;

            labelWidth = 120;
            EditorGUI.LabelField(new Rect(rect.x, height, labelWidth, 20), "Jump Anim Key");
            model.jumpAnimKey = EditorGUI.TextField(new Rect(rect.x + labelWidth, height, rect.width - labelWidth, 20), model.jumpAnimKey);
        }
    }
}
